<template>
	<view class="page" :style="themeColor">
		<view class="flex align-stretch benben-position-layout flex Withdrawals_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex align-center justify-between flex-sub Withdrawals_fd0_0'>
				<view class='flex align-center Withdrawals_fd0_0_c0' style="padding-top: 16rpx;">
					<person></person>
				</view>
				<view class='flex align-center'>
					<text class='Withdrawals_fd0_0_c1_c0'>提现</text>
				</view>
				<view class='flex align-center justify-end Withdrawals_fd0_0_c0'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view style="padding: 8rpx 32rpx 24rpx;background-color: #fff;">
			<back></back>
		</view>

		<view class="flex flex-direction align-stretch benben-flex-layout Withdrawals_flex_1">
			<text class='Withdrawals_fd1_0'>输入提现金额</text>
			<view class='flex flex-wrap align-center justify-between Withdrawals_fd1_1'>
				<view class='flex flex-wrap align-center flex-sub Withdrawals_fd1_1_c0'>
					<text class='Withdrawals_fd1_1_c0_c0'>￥</text>
					<input class='flex-sub Withdrawals_fd1_1_c0_c1' type="number" placeholder="请输入提现金额"
						confirm-type="done" :maxlength="-1"
						placeholder-style="color:rgba(153, 153, 153, 1);font-size:32rpx" v-model="fd1_1_c0_c1" />
				</view>
				<text class='Withdrawals_fd1_1_c1' @tap="quanbu">全部</text>
			</view>
			<view class='flex flex-wrap align-center Withdrawals_fd1_2'>
				<text class='Withdrawals_fd1_2_c0'>提现收取</text>
				<text class='Withdrawals_fd1_2_c0'>{{myJinBi.withdraw_ratio}}</text>
				<text class='Withdrawals_fd1_2_c0'>的手续费</text>
				<view @tap="tixianpop">
					<text class='fu-iconfont2  Withdrawals_fd1_2_c3'>&#xE600;</text>
				</view>

			</view>

		</view>



		<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout Withdrawals_flex_2">
			<text class='Withdrawals_fd2_0'>请选择提现方式</text>
			<benben-select-diy ref="showSelectPopup1661324517744"
				class-name='flex flex-direction flex-wrap align-stretch flex' :items.sync="type" v-model="type_id"
				default-type="value" default-label="name" :allow-cancel='true' type="radio" :disabled='false'>
				<template v-for='(item,key0) in type'>
					<view v-if="item.isSelected" class='flex align-center flex Withdrawals_fd2_1_c0' :key="key0"
						@tap="$refs.showSelectPopup1661324517744.tapHandle(key0)">
						<image class='Withdrawals_fd2_1_c0_c0' mode="aspectFit" :src='item.image'>
						</image>
						<text class='Withdrawals_fd2_1_c0_c1'>{{item.name}}</text>
						<image class='Withdrawals_fd2_1_c0_c2' :src='STATIC_URL+"1.png"' @tap.stop="handleJumpDiy"
							data-type="navigateTo" :data-url="`/pages/qbgl/bindBankC/bindBankC`"></image>
					</view>
					<view v-else class='flex align-center flex Withdrawals_fd2_1_c0' :key="key0"
						@tap="$refs.showSelectPopup1661324517744.tapHandle(key0)">
						<image class='Withdrawals_fd2_1_c0_c0' mode="aspectFit" :src='item.image'></image>
						<text class='Withdrawals_fd2_1_c0_c1'>{{item.name}}</text>
						<image class='Withdrawals_fd2_1_c0_c2' mode="aspectFit" :src='STATIC_URL+"53.png"'></image>
					</view>
				</template>
			</benben-select-diy>
		</view>


		<view class="flex align-start justify-center benben-position-layout flex Withdrawals_flex_3">
			<button class='Withdrawals_fd3_0' @tap.stop="withdrawFunc()">提交</button>
		</view>
		<benben-popup v-model="popupShow1686823348321" :mask="true" mode='center'>
			<!---会员规则flex布局开始-->
			<view class="flex flex-direction flex-wrap align-center benben-flex-layout">
				<view class='flex flex-direction flex-wrap align-center sexRegister_fd1_0'>
					<text class='sexRegister_fd1_0_c0'>提现规则</text>
					<image class='sexRegister_fd1_1 ' mode="aspectFit" :src='STATIC_URL+"67.png"'
						@tap.stop="popupShow1686823348321=false,is_tick=false"></image>
					<view class="ben_fu-jyf-parser_1">
						<u-parse :html="myJinBi.withdraw_rule"></u-parse>
					</view>
					<!---会员规则flex布局结束-->
					<view class="flex flex-direction align-center  flex codeLogon_flex_2">
						<view class='flex flex-wrap align-center codeLogon_fd2_0'>
						</view>
					</view>
				</view>
			</view>
		</benben-popup>
		
		<benben-popup v-model="popupShow1688203058831" :mask="true" mode='center'>
			<view class="flex flex-direction align-stretch benben-flex-layout vip_flex_311">
				<view class='flex align-center justify-center'>
					<text class='vip_fd3_0_c0'>输入支付密码</text>
				</view>
				<view class='flex align-center justify-center vip_fd3_1'>
					<benben-digital-password :box-num='6' mode='password' v-model='PayPwd'
						class-name="flex flex align-center justify-center vip_fd3_1_c0">
						<!--  @confirm="checkCodeFunc()"-->
						<template #default="{ content, active, index }">
							<view :key="index" v-if="active"
								class="flex align-center justify-center active-digital-password vip_flex_password_active_fd3_1_c0">
								{{ content }}
							</view>
							<view :key="index" v-else
								class="flex align-center justify-center vip_flex_password_noActive_fd3_1_c0">
								{{ content }}
							</view>
						</template>
					</benben-digital-password>
				</view>
				<view class='flex align-center justify-between'>
					<button class='vip_fd3_2_c0' @tap.stop="closePsd">取消</button>
					<button class='vip_fd3_2_c1' @tap.stop="checkCodeFunc()">确认</button>
					<!-- @tap.stop="goumai()" -->
				</view>
			</view>
		</benben-popup>
		
		<view :style="{height: '120rpx'}"></view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	import back from "@/components/back/index.vue"
	import person from "@/components/person/index.vue"
	export default {
		components: {
			back,
			person
		},


		data() {
			return {
				popupShow1686823348321: false,
				"popupShow1688203058831": false,
				"fd1_1_c0_c1": "",
				"type_id": "",
				"type": [{
					"name": "中国银行账户",
					"value": "3",
					"image": require('@/static/images/zhong.png')
				}, {
					"name": "欧洲银行账号",
					"value": "4",
					"image": require('@/static/images/ouzhou.png')
				}],
				"amount": "",
				money: '',
				myJinBi: {},
				"PayPwd": "",  // 支付密码
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.money = options.mymoney
			console.log(this.money, 'this.money')
			this.getmyQian()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			tixianpop() {
				this.popupShow1686823348321 = true
			},
			//全部
			quanbu() {
				this.fd1_1_c0_c1 = this.money
			},
			//我的钱
			async getmyQian() {
				let res = await this.$api.post(global.apiUrls.myjinbi)
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				this.myJinBi = res.data.data

				console.log(this.myJinBi, 'this.myJinBi')
			},
			//检测是否设置支付密码
			async getsetpay() {
				let res = await this.$api.post(global.apiUrls.a6483dd30d089c, {})
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				if (res.data.data.is_set == 0) {
					this.$message.info('您还没有设置支付密码');
					setTimeout(() => {
						this.$urouter.navigateTo('/pages/xtsz/setpay/setpay')
					}, 800)
					return false
				} else {
					this.popupShow1688203058831 = true;
					return true
				}
			},
			//提现
			async withdrawFunc() {
				if (!validate(this.fd1_1_c0_c1, 'require')) {
					this.$message.info('请输入提现金额');
					return false;
				}
				if (this.fd1_1_c0_c1 == 0) {
					this.$message.info('请输入正确的提现金额');
					return false;
				}
				if (!validate(this.type_id, 'require')) {
					this.$message.info('请选择提现方式');
					return false;
				}
				if (this.myJinBi.is_binding_en_card == 0 && this.type_id == 4) {
					this.$message.info('请绑定欧洲银行卡');
					setTimeout(() => {
						uni.navigateTo({
							// url: "/pages/qbgl/accountEUR/accountEUR"
							url: "/pages/qbgl/myAccount/myAccount"
						})
					}, 800)
					return
				}
				if (this.myJinBi.is_binding_zh_card == 0 && this.type_id == 3) {
					this.$message.info('请绑定中国银行卡');
					setTimeout(() => {
						uni.navigateTo({
							// url: "/pages/qbgl/bindBankC/bindBankC",
							url: "/pages/qbgl/myAccount/myAccount"
						})
					}, 800)
					return
				}
				this.getsetpay();
			},
			closePsd() {
				this.PayPwd = '';
				this.popupShow1688203058831 = false;
			},
			async checkCodeFunc() {
				if (!this.PayPwd) {
					this.$message.info('请输入支付密码');
					return;
				}
				this.popupShow1688203058831 = false;
				let res = await this.$api.post(global.apiUrls.tixian, {
					cash_fee: this.fd1_1_c0_c1,
					account_type: this.type_id,
					password: this.PayPwd
				})
				this.PayPwd = '';
				if (res.data.code != 1) {
					this.$message.info(res.data.msg);
					return
				}
				this.$message.info(res.data.msg);
				setTimeout(() => {
					this.$urouter.redirectTo(`/pages/qbgl/successfullyRecharged/successfullyRecharged?type=2`);
				}, 800)
			},
		}
	};
</script>
<style lang="scss" scoped>
	.vip_flex_311 {
		background: #fff;
		width: 540rpx;
		background-size: 100% auto !important;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		padding: 32rpx 24rpx 24rpx 24rpx;
	}
	
	.vip_fd3_0_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #000000;
	}
	
	.vip_fd3_1 {
		margin: 24rpx 0rpx 40rpx 0rpx;
	}
	
	::v-deep .vip_fd3_1_c0 {
		width: 750rpx;
		height: 160rpx;
	}
	
	.vip_flex_password_noActive_fd3_1_c0 {
		border: 1px solid #ccc;
		width: 68rpx;
		height: 68rpx;
		margin: 0rpx 5rpx 0rpx 5rpx;
	}
	
	.vip_fd3_2_c0 {
		background: #F2F2F2;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		font-size: 28rpx;
		color: #333;
		width: 234rpx;
		height: 72rpx;
		font-weight: 500;
		line-height: 72rpx;
	}
	
	.vip_fd3_2_c1 {
		background: #6a0002;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
		font-size: 28rpx;
		color: #e6e6e6;
		width: 234rpx;
		height: 72rpx;
		font-weight: 500;
		line-height: 72rpx;
	}
	
	.vip_flex_password_active_fd3_1_c0 {
		border: 1px solid #409EFF;
		width: 68rpx;
		height: 68rpx;
		margin: 0rpx 5rpx 0rpx 5rpx;
	}
	
	
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: rgba(246, 246, 246, 1);
		background-size: 100% auto !important;
	}

	.Withdrawals_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.sexRegister_fd1_1 {
		width: 55rpx;
		height: 55rpx;
		border-radius: 55rpx 55rpx 55rpx 55rpx;
		position: absolute;
		left: 460rpx;
		top: 20rpx;
	}

	.sexRegister_fd1_0_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
		line-height: 48rpx;
	}

	.sexRegister_fd1_0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.ben_fu-jyf-parser_1 {
		background-color: #ffffff;
		padding-left: 16rpx;
		padding-right: 16rpx;
		padding-top: 16rpx;
		padding-bottom: 16rpx;
	}

	.sexRegister_fd1_0 {
		background: #fff;
		width: 540rpx;
		border-radius: 24rpx 24rpx 24rpx 24rpx;
		background-size: 100% auto !important;
		padding: 28rpx 32rpx 32rpx 32rpx;
	}

	.Withdrawals_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
	}

	.Withdrawals_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
	}

	.Withdrawals_fd0_0_c0 {
		width: 180rpx;
	}

	.Withdrawals_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.Withdrawals_flex_1 {
		border-top: 10px solid #F8F8F8;
		border-bottom: 10px solid #F8F8F8;
		background: #fff;
		background-size: 100% auto !important;
		padding: 32rpx 32rpx 32rpx 32rpx;
	}

	.Withdrawals_fd1_2_c3 {
		margin: 0rpx 0rpx 0rpx 16rpx;
		color: #999999;
		font-size: 24rpx;
		font-weight: 400;
	}

	.Withdrawals_fd1_2_c0 {
		line-height: 53rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: #999999;
	}

	.Withdrawals_fd1_2 {
		margin: 24rpx 0rpx 24rpx 0rpx;
	}

	.Withdrawals_fd1_1_c1 {
		font-size: 32rpx;
		font-weight: 500;
		color: var(--benbenFontColor1);
	}

	.Withdrawals_fd1_1_c0_c1 {
		padding: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
	}

	.Withdrawals_fd1_1_c0_c0 {
		font-size: 50rpx;
		font-weight: 400;
		color: #333333;
	}

	.Withdrawals_fd1_1_c0 {
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.Withdrawals_fd1_1 {
		border-bottom: 1px solid #eee;
	}

	.Withdrawals_fd1_0 {
		font-size: 24rpx;
		font-weight: 500;
		color: #333333;
	}

	.Withdrawals_flex_2 {
		background: #fff;
		background-size: 100% auto !important;
		padding: 32rpx 30rpx 2rpx 32rpx;
	}

	.Withdrawals_fd2_1_c0_c2 {
		width: 36rpx;
		height: 36rpx;
		margin: 0rpx 0rpx 0rpx auto;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
	}

	.Withdrawals_fd2_1_c0_c1 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333;
	}

	.Withdrawals_fd2_1_c0_c0 {
		width: 52rpx;
		height: 52rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 16rpx 0rpx 0rpx;
	}

	.Withdrawals_fd2_1_c0 {
		border-bottom: 1px solid #eee;
		padding: 28rpx 0rpx 28rpx 0rpx;
	}

	.Withdrawals_fd2_0 {
		font-size: 32rpx;
		font-weight: 700;
		color: #333333;
		margin: 0rpx 0rpx 8rpx 0rpx;
	}

	.Withdrawals_flex_3 {
		background: rgba(246, 246, 246, 1);
		width: 750rpx;
		height: 120rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(0rpx + var(--window-bottom));
		background-size: 100% auto !important;
	}

	.Withdrawals_fd3_0 {
		background: #6A0002;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		width: 686rpx;
		height: 88rpx;
		line-height: 88rpx;
		font-weight: 500;
	}
</style>